/*
 * EtatRobot.h
 *
 *  Created on: 12 nov. 2012
 *      Author: guegan
 */

#ifndef ETATROBOT_H_
#define ETATROBOT_H_

#include <string>
#include <map>
#include "Objet.h"
#include "Obstacle.h"
#include "Robot.h"

using namespace std;

class EtatRobot {

protected:
	static Robot* robot;

private:
	static map<string, EtatRobot*> mapEtat;
	string _nom;

public:
	EtatRobot(string nom);

	class AvancerException{};
	class TournerException{};
	class SaisirException{};
	class PeserException{};
	class PoserException{};
	class RencontrerObstacleException{};
	class EvaluerObstacleException{};
	class FigerException{};
	class RepartirException{};
	class AfficherException{};


	virtual void avancer(int x , int y){ throw AvancerException(); };
	virtual void tourner(string direction){ throw TournerException(); };
	virtual void saisir(Objet o){ throw SaisirException(); };
	virtual int  peser() { throw PeserException(); };
	virtual void poser() { throw PoserException(); };
	virtual void rencontrerObstacle(Obstacle o) { throw RencontrerObstacleException(); };
	virtual int evaluerObstacle() { throw EvaluerObstacleException();};
	virtual void figer(){ throw FigerException(); };
	virtual void repartir() { throw RepartirException(); };
	virtual void afficher() { throw AfficherException(); };

	void mapA(string s);
	EtatRobot* getEtatInitial();
	static void setRobot(Robot* rob) { robot = rob;}
	void creerEtats();
	EtatRobot* getEtatRobot(string nom){ return mapEtat[nom]; }

	string getNom(){ return _nom; }

	virtual ~EtatRobot();
};

#endif /* ETATROBOT_H_ */
